#include <QCoreApplication>
#include <QDebug>
#include "../src/MyTpThread.h"
#include "../serialPortThread/serialPortThread.h"
#include "TestThread.h"

FILE *output=NULL;
void redirectOutput(QtMsgType type,const QMessageLogContext & c,const QString &msg)
{
    QByteArray localMsg=msg.toLocal8Bit();
    fprintf(output, "%s\n",localMsg.constData());
    fflush(output);
}
void test_tp(QCoreApplication * app){
    // MyTpThread mytp;
    // mytp.start(QThread::HighPriority);
    // QObject::connect(&mytp, SIGNAL(finished()), app, SLOT(quit()));
}

void test_t(QCoreApplication * app)
{
    TestThread tt(app);
}
int main(int argc, char *argv[])
{
    output=stdout;
    qInstallMessageHandler(redirectOutput);
    QCoreApplication app(argc, argv);
    qDebug()<<"begin";
    test_t(&app);
    
    return app.exec();
}